package com.welsy.usermgt.command
{
	import com.adobe.cairngorm.commands.Command;
	import com.adobe.cairngorm.model.ModelLocator;
	import com.adobe.cairngorm.control.CairngormEvent;
	import flash.events.Event;
	import com.welsy.usermgt.business.SearchDelegate;
	import com.welsy.usermgt.event.SearchEvent;
	import com.welsy.usermgt.model.UserMgtModelLocator;
	import mx.controls.Alert;
	import com.welsy.usermgt.vo.SearchVO;
	import com.welsy.usermgt.vo.UsrResultVO;
	import mx.collections.ArrayCollection;
	import com.welsy.usermgt.vo.UserVO;
	import mx.rpc.IResponder;
	import com.welsy.usermgt.event.EditUserEvent;
	import com.welsy.usermgt.business.EditUserDelegate;
	
	public class EditUserCommand implements Command, IResponder
	{
		private var model : UserMgtModelLocator = UserMgtModelLocator.getInstance();
		
		public function execute(event : CairngormEvent):void {
			var delegate : EditUserDelegate = new EditUserDelegate(this);
			var editUserEvent : EditUserEvent = EditUserEvent(event);
			
			delegate.performEdit(editUserEvent.userVO);
		}
		
		public function result( event : Object) :void {		
		}
		
		public function fault( event : Object ):void {
			//TODO: report the error
			Alert.show("usermgt.command.EditUserCommand.fault!");
		}
	}
}